.data 0x0000
	
.text 0x0000
start:  lui $1,0xFFFF
        ori $28, $1, 0xF000
        ori $25, $0, 0x5555
        ori $24, $0, 0xaaaa
        ori $23, $0, 0x0000
        ori $2, $0, 0x0020
        ori $4, $0, 0x0040
        ori $6, $0, 0x0060
        ori $8, $0, 0x0080
        ori $10,$0, 0x00a0
        ori $12,$0, 0x00c0
        
        j judge
        


switled:
	sw  $24, 0xC60($28)
	sw  $25, 0xC60($28)
	lw  $22, 0xC72($28)
	bne $22, $0, judge
	j   switled
	
assign:
	lw  $21, 0xC70($28)
	sw  $21, 0xC60($28)
	sw  $23, 0xC62($28)
	lw  $22, 0xC72($28)
	bne $22, $2, judge
	j   assign

plus:
	addi $21, $21, 1
	sw   $21, 0xC60($28)
	sw   $23, 0xC62($28)
	lw   $22, 0xC72($28)
	bne  $22, $4,judge
	j    plus

minus:
	addi $21, $21, -1
	sw   $21, 0xC60($28)
	sw   $23, 0xC62($28)
	lw   $22, 0xC72($28)
	bne  $22, $6,judge
	j    minus
	
sl:
	sll  $21, $21, 1
	sw   $21, 0xC60($28)
	sw   $23, 0xC62($28)
	lw   $22, 0xC72($28)
	bne  $22, $8,judge
	j    sl

srll:
	srl  $21, $21, 1
	sw   $21, 0xC60($28)
	sw   $23, 0xC62($28)
	lw   $22, 0xC72($28)
	bne  $22, $10,judge
	j    srll
	
sraa:
	sra  $21, $21, 1
	sw   $21, 0xC60($28)
	sw   $23, 0xC62($28)
	lw   $22, 0xC72($28)
	bne  $22, $12,judge
	j    sraa

judge:
	lw  $22, 0xC72($28)
	beq $22, $2, assign
	beq $22, $4, plus
	beq $22, $6, minus
	beq $22, $8, sl
	beq $22, $10, srll
	beq $22, $12, sraa
	j   switled
	

	
       
       
